using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using AdminSG3L.Applicaticn.Services;
using AdminSG3L.Applicaticn.ServicesInterface;

namespace AdminSG3L.Applicaticn;

public static class ServiceCollectionExtension
{
    /// <summary>
    /// 注册应用层服务
    /// </summary>
    public static IServiceCollection AddApplication(this IServiceCollection services, IConfiguration configuration)
    {
        // 注册应用层服务
        services.AddScoped<IUserService, UserService>();
        services.AddScoped<IRoleService, RoleService>();
        services.AddScoped<IPermissionService, PermissionService>();
        services.AddScoped<IMenuService, MenuService>();
        services.AddScoped<IAuthService, AuthService>();
        services.AddScoped<IAnalyticsService, AnalyticsService>();
        services.AddScoped<ISystemService, SystemService>();
        services.AddScoped<ILogService, LogService>();
        services.AddScoped<IFileUploadService, GiteeFileUploadService>();
        
        return services;
    }
}